<script setup lang="ts">
import {getCurrentInstance, inject, ref} from "vue";

const {proxy} = getCurrentInstance() as any; // 类似于this
let loading = inject('loading',ref(false))
let loadingTxt = inject('loadingTxt',ref('加载中...'))
</script>

<template>
<div>
  <van-overlay id="vanOverlay" :show="loading">
    <img src="@/assets/icon.png" style="width: 40px;height: 40px;margin-bottom: 5px" alt="">
    <van-loading size="24px" color="#0094ff">{{ loadingTxt }}</van-loading>
  </van-overlay>
</div>
</template>

<style scoped lang="scss">
#vanOverlay {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  z-index: 999;
  font-size: 14px;
  color: white;
}
</style>